package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "无相之岩")
@Order(1006)
@Component
public class WuXiangYan extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int dmg;
        String desc;
        int i = RandomUtil.randomInt(100);
        int orgAtk = first.getBattleInfo().getDef() + i;
        int def = second.getBattleInfo().getDef();
        int atk = (int) (orgAtk * 1.1);
        dmg = battleHelper.calAtk(atk, def);
        desc = RandomUtil.choice(Lists.newArrayList("岩陨", "巨石锤", "崩裂重击"));

        battleHelper.autoAction(this, first, second, content, dmg, desc);
    }

    @Override
    public void limit(UserBO user) {
        throw new HandlerException("无法学习妖兽的攻击手段");
    }

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return "代号「基末尔」的高级岩元素生命。\n" +
                "无相元素本身是超浓缩的构造体，拥有极高的质量。\n" +
                "浓缩成硬质固体的元素超质壳是惰性的，只有内部的核会活跃发生元素反应。这些外壳上的纹样由来，至今也无人可解。\n\n" +
                "会根据自己的物抗对玩家造成物理伤害 \n" +
                "技能 ：岩陨,巨石锤,崩裂重击\n\n" +
                "掉落物：\n" +
                "坚牢黄玉碎屑，坚牢黄玉断片，坚牢黄玉块";
    }


}
